package org.swidgets.base.smessagebox;



import org.swidgets.base.BorderStyleRepository;

import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;

public class SDialogBox extends Composite  {	
	private PopupPanel container;
	private DragableFrame frame;
	
	public void setBodyWidget(Widget w) {
		frame.setBodyWidget(w);
	}

	public void setFooterWidget(Widget w) {
		frame.setFooterWidget(w);
	}

	public void setHeaderWidget(Widget w) {
		frame.setHeaderWidget(w);
	}

	public void hideFooter() {
		frame.hideFooter();
	}

	public void hideHeader() {
		frame.hideHeader();
	}

	public void showFooter() {
		frame.showFooter();
	}

	public void showHeader() {
		frame.showHeader();
	}

	public SDialogBox() {
		super();
		container = new PopupPanel (false,true);
		container.setWidth("200px");
		frame = new DragableFrame();			  
		frame.setStyle(BorderStyleRepository.dialogTrasp);
		container.add(frame);
	}
	
	 public Element getPositionAnchor(){
		 return frame.getElement();
	 }

	public void hide() {
		container.hide();
	}

	public void show() {
		container.show();
	}

	public void setTitle(String title) {
		frame.setTitle(title);
	}

	public void center() {
		container.center();
	}

	public void setPopupPosition(int left, int top) {
		container.setPopupPosition(left, top);
	}	
	
	public void setCaption (String caption){
		frame.setCaption(caption);
	}
	
	
}
